import { Navigate, useRoutes } from 'react-router-dom'
import Login from '../components/Login'
import Main from '../components/Main'
import NotFound from '../components/404'
import About from '../components/Main/About'
import Home from '../components/Main/Home'
import Music from '../components/Main/Home/Music'
import News from '../components/Main/Home/News'
const routes = [
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '/main',
        element: <Main />,
        children: [
            {
                path: "/main/about",
                element: <About />,
            },
            {
                path: "/main/home",
                element: <Home />,
                children: [
                    {
                        path: "/main/home/music",
                        element: <Music />,
                    },
                    {
                        path: "/main/home/News",
                        element: <News />,
                    }
                ]
            },
        ]
    },
    {
        path: '/',
        element: <Navigate to='/login' />
    },
    {
        path: '*',
        element: <NotFound />
    }
]

export const GetRoutes = () => {
    return useRoutes(routes)
}

export const useMyRoutes = () => {
    return useRoutes(routes)
}